package com.xy.pattern.prototype;

import lombok.Data;

@Data
public class Person implements Cloneable{
    private String id;
    private String name;
    private Location loc;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        Person person = (Person) super.clone();
        Location loc2 = (Location) loc.clone();
        person.setLoc(loc2);
        return person;
    }
}
